package com.mfangsoft.zhuangjialong.common.utils;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;

public class CacheUtil {
	
	
	
	public static LoadingCache<String, String> Cache = CacheBuilder.newBuilder()
	            .expireAfterWrite(7198, TimeUnit.SECONDS)// 缓存2 小时
	            .maximumSize(1000)// 最多缓存1000个对象
	            .build(new CacheLoader<String, String>() {
	                public String load(String key) throws Exception {
	                    
	                    return key;
	                }
	            });
	public static LoadingCache<String, String> Cache1 = CacheBuilder.newBuilder()
			.expireAfterWrite(598, TimeUnit.SECONDS)// 缓存2 小时
			.maximumSize(1000)// 最多缓存1000个对象
			.build(new CacheLoader<String, String>() {
				public String load(String key) throws Exception {
					
					return key;
				}
			});
}
